/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.group4.highschoolportal.student.backingbean;

import com.group4.controller.StudentFacade;
import com.group4.entity.Student;
import com.group4.highschoolportal.loginBean.IndexBackingBean;
import java.io.Serializable;
import javax.ejb.EJB;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.ManagedProperty;
import javax.faces.bean.RequestScoped;

/**
 *
 * @author Victor Cernea
 */
@ManagedBean
@RequestScoped
public class StudentHomeControllerBean implements Serializable {
    @ManagedProperty(value = "#{indexBackingBean}")
    private IndexBackingBean ib;
    
    private Student stud;
    
    @ManagedProperty(value = "#{studentBackingBean}")
    private StudentBackingBean sb;
    
    @EJB
    StudentFacade sdb;

    /** Creates a new instance of StudentHomeControllerBean */
    public StudentHomeControllerBean() {
        System.out.print(sdb.findByLogin(ib.getUsername(), ib.getPassword()).toString());
        sb.setStud(sdb.findByLogin(ib.getUsername(), ib.getPassword()));
    }

    public Student getStud() {
        return stud;
    }

    public void setStud(Student stud) {
        this.stud = stud;
    }

    public IndexBackingBean getIb() {
        return ib;
    }

    public void setIb(IndexBackingBean ib) {
        this.ib = ib;
    }

    public StudentFacade getSdb() {
        return sdb;
    }

    public void setSdb(StudentFacade sdb) {
        this.sdb = sdb;
    }
    
    
    
}
